//---------------------------------------------------------------------------

#ifndef route_descSFH
#define route_descSFH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "AdvToolBar.hpp"
#include "AdvToolBarStylers.hpp"
#include <Data.DB.hpp>
#include <Data.Win.ADODB.hpp>
#include "AdvGlowButton.hpp"
#include "AdvGrid.hpp"
#include "AdvGroupBox.hpp"
#include "AdvObj.hpp"
#include "BaseGrid.hpp"
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Grids.hpp>
#include "AdvOfficeButtons.hpp"
#include "AdvEdit.hpp"
//---------------------------------------------------------------------------
class Troute_desc : public TAdvToolBarForm
{
__published:	// IDE-managed Components
	TAdvToolBarOfficeStyler *advtlbrfcstylr1;
	TAdvToolBarPager *tb1;
	TDataSource *dsRuns;
	TADOQuery *qryRuns;
	TComboBox *cbRuns;
	TComboBox *cbRoutes;
	TLabel *lbl1;
	TLabel *lbl2;
	TAdvGlowButton *btnAddRun;
	TAdvGroupBox *grpRuns;
	TAdvStringGrid *sgStops;
	TAdvOfficeRadioGroup *advfcrdgrpRunType;
	TLabel *lblStops;
	TDataSource *dsSpans;
	TADOQuery *qrySpans;
	TLabel *lblStopTime;
	TLabel *lblInterval;
	TAdvGlowButton *btnDelRun;
	TAdvEdit *edtSTime;
	TLabel *lblAdd;
	TLabel *lblName;
	TLabel *lblGo;
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall cbRoutesChange(TObject *Sender);
	void __fastcall cbRunsChange(TObject *Sender);
	void __fastcall sgStopsCellsChanged(TObject *Sender, TRect &R);
	void __fastcall btnAddRunClick(TObject *Sender);
	void __fastcall edtSTimeChange(TObject *Sender);
	void __fastcall btnDelRunClick(TObject *Sender);
	void __fastcall advfcrdgrpRunTypeRadioButtonClick(TObject *Sender);
	void __fastcall sgStopsSelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect);
	void __fastcall sgStopsEditingDone(TObject *Sender);
	void __fastcall cbRunsKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall edtSTimeKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall sgStopsKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall sgStopsCellChanging(TObject *Sender, int OldRow, int OldCol, int NewRow,
          int NewCol, bool &Allow);
	void __fastcall FormResize(TObject *Sender);
	private:	// User declarations
	public:		// User declarations
	__fastcall Troute_desc(TComponent* Owner);
	friend void __fastcall FillCombo(TComboBox *Combo,String db_table,bool bSort,String sFieldName,bool bClearBefore,bool bGroup);
	int RouteId;
	int __fastcall GetRuns();
	void __fastcall LoadRuns(String Run);
	void __fastcall AddNewRun(int RouteId);
	void __fastcall SaveRun(int RouteId);
	void __fastcall DelRun(int RouteId);
};
//---------------------------------------------------------------------------
extern PACKAGE Troute_desc *route_desc;
//---------------------------------------------------------------------------
#endif
